<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>products</title>
    <link rel="stylesheet" th:href="@{../static/bootstrap/css/bootstrap.css}" />
    <script th:src="@{../static/js/jquery.js}"></script>
    <script th:src="@{../static/bootstrap/js/bootstrap.js}"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<!--/*@thymesVar id="name" type="java.lang.String"*/-->
<div class="container">
    <table class="table table-striped">
        <tr>
            <th>name</th>
        </tr>

        <tr th:each="products:${pageInfo.list}">
            <td th:text="${products.good_name}"></td>
        </tr>

    </table>

    <nav>
        <!--<ul class="pagination" th:each="data:${list}">-->
            <!--<li th:text="${data.get('good_name')}"></li>-->
        <!--</ul>-->

        <ul class="pagination">
            <li>
                <a th:if="${not isFirstPage}" th:href="@{${'allproducts'}(pageNum=${pageNum-1},pageSize=${pageSize})}" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
                <a th:if="${isFirstPage}" href="javascript:void(0);" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>

            <li th:each="pageNo : ${#numbers.sequence(1,totalPage)}">
                <a th:if="${pageNum eq pageNo}" href="javascript:void(0);">
                    <span th:text="${pageNo}"></span>
                </a>

                <a th:if="${not (pageNum eq pageNo)}" th:href="@{${'allproducts'}(pageNum=${pageNo},pageSize=${pageSize})}">
                    <span th:text="${pageNo}"></span>
                </a>
            </li>

            <li>
                <a th:if="${not isLastPage}" th:href="@{${'allproducts'}(pageNum=${pageNum-1},pageSize=${pageSize})}" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
                <a th:if="${isLastPage}" href="javascript:void(0);" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </ul>
    </nav>
</div>
</body>
</html>